import java.io.*;

class reverse_words {

public static void main (String[] args) {

    try {
        File file = new File(args[0]);
        BufferedReader in = new BufferedReader(new FileReader(file));
        String line;
        while ((line = in.readLine()) != null) {
            String[] lineArray = line.split("\\s");
            if (lineArray.length > 0) {
                for (int i = 0; i<lineArray.length/2;i++) {
                    String tmp = lineArray[i];
                    lineArray[i] = lineArray[lineArray.length -i -1];
                    lineArray[lineArray.length -i -1] = tmp;
                    
                }
                for (int i = 0; i<lineArray.length;i++){
                    if(i== lineArray.length-1){
                        System.out.print(lineArray[i]);
                    } else {
                        System.out.print(lineArray[i]+" ");
                    }
                }
                System.out.println();
            } 
        }
    } catch (IOException e) {
        System.out.println("File Read Error: " + e.getMessage());
    }               
}
}